/* indent size: 1 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Model = app.model.define('auth_user_shop', {
    id: {
      type: DataTypes.INTEGER(8).UNSIGNED,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    user_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      comment: '用户ID',
    },
    shop_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      comment: '商家ID',
    },
    is_delete: {
      type: DataTypes.INTEGER(1).UNSIGNED,
      allowNull: false,
      defaultValue: '0',
      comment: '是否删除，0->存在，1->删除'
    },
  }, {
    tableName: 'auth_user_shop',
    timestamps: false,
  });

  Model.sync({ alter: true });
  Model.associate = function() {
  }
  
  return Model;
};
